home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / MiscStringCompatability.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-25  |  10.5 KB  |  232 lines

  1. //
  2. //    MiscString.h -- a generic class to simplify manipulation of (char *)'s
  3. //        Written by Don Yacktman Copyright (c) 1993, 1994 by Don Yacktman.
  4. //                Version 1.95.  All rights reserved.
  5. //        This notice may not be removed from this source code.
  6. //
  7. //    This object is included in the MiscKit by permission from the author
  8. //    and its use is governed by the MiscKit license, found in the file
  9. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  10. //    for a list of all applicable permissions and restrictions.
  11. //    
  12.  
  13. // These methods make a MiscString easier to use when moving from some
  14. // other string class to the MiscString.  All these methods are simply
  15. // covers for the real MiscString method, so you should not use any of
  16. // these in a new program.  Look for the _real_ MiscString method and
  17. // use it instead.  Avoid these methods as any or all of them could
  18. // disappear at any time in the future!
  19.  
  20. #ifndef _HEADER_VIEWER_
  21.  
  22. @interface MiscString(Compat)
  23.  
  24. // Compatability method; do not use this in a new program:
  25. - takeStringValue:sender;
  26. // Compatability method; do not use this in a new program:
  27. - clear;
  28. // Compatability method; do not use this in a new program:
  29. - (const char *)string;
  30. // Compatability method; do not use this in a new program:
  31. - setString:(const char *)aString;
  32. // Compatability method; do not use this in a new program:
  33. - replaceChar:(char)aChar withChar:(char)replaceChar;
  34. // Compatability method; do not use this in a new program:
  35. - addToEndOfString:(const char *)aString;
  36. // Compatability method; do not use this in a new program:
  37. - addToFrontOfString:(const char *)aString;
  38. // Compatability method; do not use this in a new program:
  39. - addCharToEndOfString:(char)aChar;
  40. // Compatability method; do not use this in a new program:
  41. - addCharToFrontOfString:(char)aChar;
  42. // Compatability method; do not use this in a new program:
  43. - (int)numberFields;
  44. // Compatability method; do not use this in a new program:
  45. - (char *)nthField:(int)fieldNumber useAsDelimiter:(char)c;
  46. // Compatability method; do not use this in a new program:
  47. - (char *)nthField:(int)fieldNumber;
  48. // Compatability method; do not use this in a new program:
  49. - (char *)nthQuotedField:(int)fieldNumber;
  50. // Compatability method; do not use this in a new program:
  51. - (char *)lastField;
  52. // Compatability method; do not use this in a new program:
  53. - (char *)firstField;
  54. // Compatability method; do not use this in a new program:
  55. - addStrings:(const char *)fields,  ...;
  56. // Compatability method; do not use this in a new program:
  57. - replaceEveryInstanceOfChar:(char)aChar withChar:(char)replaceChar;
  58. // Compatability method; do not use this in a new program:
  59. - replaceEveryInstanceOfChar:(char)aChar with:(char)replaceChar;
  60.  
  61. // MOString compatability
  62. // Compatability method; do not use this in a new program:
  63. - convertToUpper;
  64. // Compatability method; do not use this in a new program:
  65. - convertToLower;
  66. // Compatability method; do not use this in a new program:
  67. - (int)replaceAllOccurrencesOfChar:(char)oldChar with:(char)newChar;
  68. // Compatability method; do not use this in a new program:
  69. - (char)replaceCharAt:(int)index with:(char)newChar;
  70. // Compatability method; do not use this in a new program:
  71. - insertStringValue:(const char *)s at:(int)position;
  72. // Compatability method; do not use this in a new program:
  73. - preCatStringValue:(const char *)s;
  74. // Compatability method; do not use this in a new program:
  75. - preCat:stringObject;
  76. // Compatability method; do not use this in a new program:
  77. - preCatFromFormat:(const char *)format, ...;
  78. // Compatability method; do not use this in a new program:
  79. - catStringValue:(const char *)s;
  80. // Compatability method; do not use this in a new program:
  81. - (int)compare:stringObject caseSensitive:(BOOL)flag;
  82. // Compatability method; do not use this in a new program:
  83. - (int)compare:stringObject caseSensitive:(BOOL)flag length:(int)length;
  84. // Compatability method; do not use this in a new program:
  85. - (int)compare:stringObject caseSensitive:(BOOL)flag length:(int)length 
  86.             withTable:(NXStringOrderTable *)table;
  87. // Compatability method; do not use this in a new program:
  88. - (int)compareStr:(const char *)s;
  89. // Compatability method; do not use this in a new program:
  90. - (int)compareStr:(const char *)s caseSensitive:(BOOL)flag;
  91. // Compatability method; do not use this in a new program:
  92. - (int)compareStr:(const char *)s caseSensitive:(BOOL)flag length:(int)length;
  93. // Compatability method; do not use this in a new program:
  94. - (int)compareStr:(const char *)s caseSensitive:(BOOL)flag length:(int)length
  95.             withTable:(NXStringOrderTable *)table;
  96. // Compatability method; do not use this in a new program:
  97. - (int)endCompare:stringObject caseSensitive:(BOOL)flag;
  98. // Compatability method; do not use this in a new program:
  99. - (int)endCompare:stringObject caseSensitive:(BOOL)flag length:(int)length;
  100. // Compatability method; do not use this in a new program:
  101. - (int)endCompare:stringObject caseSensitive:(BOOL)flag length:(int)length 
  102.             withTable:(NXStringOrderTable *)table;
  103. // Compatability method; do not use this in a new program:
  104. - (int)endCompareStr:(const char *)s;
  105. // Compatability method; do not use this in a new program:
  106. - (int)endCompareStr:(const char *)s caseSensitive:(BOOL)flag;
  107. // Compatability method; do not use this in a new program:
  108. - (int)endCompareStr:(const char *)s caseSensitive:(BOOL)flag 
  109.             length:(int)length;
  110. // Compatability method; do not use this in a new program:
  111. - (int)endCompareStr:(const char *)s caseSensitive:(BOOL)flag 
  112.             length:(int)length withTable:(NXStringOrderTable *)table;
  113. // Compatability method; do not use this in a new program:
  114. - substringFrom:(int)start to:(int)end;
  115. // Compatability method; do not use this in a new program:
  116. - (int)positionOf:(char)aChar nthOccurrence:(int)n;
  117. // Compatability method; do not use this in a new program:
  118. - (int)countOccurrencesOf:(char)aChar;
  119. // Compatability method; do not use this in a new program:
  120. - (size_t)strlen;
  121. // Compatability method; do not use this in a new program:
  122. - (const char *)strcpy:(const char *)s;
  123. // Compatability method; do not use this in a new program:
  124. - (const char *)strncpy:(const char *)s :(size_t)n;
  125. // Compatability method; do not use this in a new program:
  126. - (const char *)strcat:(const char *)s;
  127. // Compatability method; do not use this in a new program:
  128. - (const char *)strncat:(const char *)s :(size_t)n;
  129. // Compatability method; do not use this in a new program:
  130. - (int)strcmp:(const char *)s;
  131. // Compatability method; do not use this in a new program:
  132. - (int)strncmp:(const char *)s :(size_t)n;
  133. // Compatability method; do not use this in a new program:
  134. - (const char *)strchr:(char)aChar;
  135. // Compatability method; do not use this in a new program:
  136. - (const char *)strrchr:(char)aChar;
  137. // Compatability method; do not use this in a new program:
  138. - (const char *)strpbrk:(const char *)breakChars;
  139. // Compatability method; do not use this in a new program:
  140. - (size_t)strspn:(const char *)acceptableChars;
  141. // Compatability method; do not use this in a new program:
  142. - (size_t)strcspn:(const char *)breakChars;
  143. // Compatability method; do not use this in a new program:
  144. - initStringValue:(const char *)s;
  145. // Compatability method; do not use this in a new program:
  146. - initStringValueNoCopy:(char *)s; // the const is how it should be
  147. // Compatability method; do not use this in a new program:
  148. - initStringValueNoCopy:(char *)s shouldFree:(BOOL)flag;
  149. // Compatability method; do not use this in a new program:
  150. - initStringValueUnique:(const char *)s;
  151. // Compatability method; do not use this in a new program:
  152. - deepCopy;
  153. // Compatability method; do not use this in a new program:
  154. - deepCopyFromZone:(NXZone *)zone;
  155. // Compatability method; do not use this in a new program:
  156. - shallowCopy;
  157. // Compatability method; do not use this in a new program:
  158. - shallowCopyFromZone:(NXZone *)zone;
  159. // Compatability method; do not use this in a new program:
  160. - setStringValueNoCopy:(const char *)s; // the const is how it should be
  161. // Compatability method; do not use this in a new program:
  162. - setStringValueNoCopy:(char *)s shouldFree:(BOOL)flag;
  163. // Compatability method; do not use this in a new program:
  164. - setStringValueUnique:(const char *)s;
  165. // Compatability method; do not use this in a new program:
  166. - setNull;
  167. // Compatability method; do not use this in a new program:
  168. - makeUnique;
  169. // Compatability method; do not use this in a new program:
  170. - setShouldFree:(BOOL)flag;
  171. // Compatability method; do not use this in a new program:
  172. - (unsigned int)count;
  173. // Compatability method; do not use this in a new program:
  174. - (BOOL)isNull;
  175. // Compatability method; do not use this in a new program:
  176. - (BOOL)isEmpty;
  177. // Compatability method; do not use this in a new program:
  178. - (BOOL)isUnique;
  179. // Compatability method; do not use this in a new program:
  180. - (BOOL)shouldFree;
  181.  
  182. // MOPathString extras
  183. // Compatability method; do not use this in a new program:
  184. - (int)numberOfComponents;
  185. // Compatability method; do not use this in a new program:
  186. - componentAt:(int)index;
  187. // Compatability method; do not use this in a new program:
  188. - file;
  189. // Compatability method; do not use this in a new program:
  190. - directory; // warning:  conflicts with NeXT headers:  id vs. (const char *)
  191. // Compatability method; do not use this in a new program:
  192. - (const char *)path;
  193. // Compatability method; do not use this in a new program:
  194. - (BOOL)isRelative;
  195. // Compatability method; do not use this in a new program:
  196. - (BOOL)isAbsolute;
  197. // Compatability method; do not use this in a new program:
  198. - (BOOL)isDirectory;
  199. // Compatability method; do not use this in a new program:
  200. - (BOOL)isPlainFile;
  201. // Compatability method; do not use this in a new program:
  202. - (BOOL)isSymbolicLink;
  203. // Compatability method; do not use this in a new program:
  204. - (BOOL)isCharacterSpecial;
  205. // Compatability method; do not use this in a new program:
  206. - (BOOL)isBlockSpecial;
  207. // Compatability method; do not use this in a new program:
  208. - (BOOL)isSocket;
  209. // Compatability method; do not use this in a new program:
  210. - setPathSeparator:(char)c; // NO OP.
  211.                     // Use a cast to avoid conflicts w/NXBrowser method.
  212. // Compatability method; do not use this in a new program:
  213. - setExtensionSeparator:(char)c; // NO OP
  214. // Compatability method; do not use this in a new program:
  215. - (char)pathSeparator;
  216. // Compatability method; do not use this in a new program:
  217. - (char)extensionSeparator;
  218. // Compatability method; do not use this in a new program:
  219. - setPath:(const char *)path;
  220. // Compatability method; do not use this in a new program:
  221. - initPath:(const char *)path;
  222. // Compatability method; do not use this in a new program:
  223. - (char *)buffer; // don't free this return value!!!
  224.  
  225. // NSString emulations.  First two courtesy of Scott Anguish:
  226. - (BOOL)hasPrefix:(const char *)value;
  227. - (BOOL)hasPrefixString:value;
  228.  
  229. @end
  230.  
  231. #endif
  232.